package com.mobileshop.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class EncodingFilter implements Filter{
	
	public String encoder="UTF-8";

	public void destroy() {
		
	}

	public void doFilter(ServletRequest req, ServletResponse reps,
		FilterChain fc) throws IOException, ServletException {
		req.setCharacterEncoding(encoder);
		fc.doFilter(req, reps);
	}

	public void init(FilterConfig arg0) throws ServletException {
		
	}

}